#ifndef _CVECTOR3_H
#define _CVECTOR3_H

#include <math.h>

struct CVector3
{
public:

	// A default constructor
	CVector3() {}

	// This is our constructor that allows us to initialize our data upon creating an instance
	CVector3(float X, float Y, float Z)
	{
		x = X; y = Y; z = Z;
	}

	// Here we overload the + operator so we can add vectors together
	CVector3 operator+(CVector3 vVector)
	{
		// Return the added vector's result.
		return CVector3(vVector.x + x, vVector.y + y, vVector.z + z);
	}

	// Here we overload the - operator so we can subtract vectors
	CVector3 operator-(CVector3 vVector)
	{
		// Return the subtracted vector's result
		return CVector3(x - vVector.x, y - vVector.y, z - vVector.z);
	}

	// Here we overload the * operator so we can multiply by scalars
	CVector3 operator*(float num)
	{
		// Return the scaled vector
		return CVector3(x * num, y * num, z * num);
	}

	// Here we overload the / operator so we can divide by a scalar
	CVector3 operator/(float num)
	{
		// Return the scale vector
		return CVector3(x / num, y / num, z / num);
	}

    static CVector3 Cross(CVector3 vVector1, CVector3 vVector2);
	static float Magnitude(CVector3 vNormal);
	static CVector3 Normalize(CVector3 vVector);
	static CVector3 Create(CVector3 vPoint1, CVector3 vPoint2); // creates a new vector out of 2 points

	float x, y, z;
};

#endif
